[Unit]
Description=Rocketmq Nameserver: {{ rocketmq_nameserver_servicename }}
After=syslog.target network.target remote-fs.target nss-lookup.target

[Service]
User={{ rocketmq_user }}
Group={{ rocketmq_group }}
Type=forking
Environment=ROCKETMQ_HOME={{ rocketmq_home_dir }}
Environment=PrivateTmp=true
ExecStart=/usr/bin/nohup sh -ac '. /etc/profile.d/java_home.sh; {{ rocketmq_home_dir }}/bin/runserver.sh org.apache.rocketmq.namesrv.NamesrvStartup -c {{ rocketmq_nameserver_conf_file }} > {{ rocketmq_nameserver_logfile }} 2>&1 &'
ExecStop={{ rocketmq_home_dir }}/bin/mqshutdown namesrv

[Install]
WantedBy=multi-user.target
